package com.aaxis.microservice.training.demo1.message;

import com.aaxis.microservice.training.demo1.domain.User;
import lombok.extern.slf4j.Slf4j;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;

/**
 * Created by terrence on 2018/10/22.
 */
@Component
@Slf4j
public class KafkaUserConsumer {

    @KafkaListener(id = "test", topics = { "topic-test" })
    public void listen(User pUser) {
        log.info("listen() receive message, user id:{}, name:{}, pass:{}", pUser.getId(), pUser.getUsername(),
                pUser.getPassword());
    }
}